package org.lendoo.web.config;

import org.lendoo.web.value.ThreadPoolValue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.annotation.Resource;

@Configuration
public class ManagerConfig {

    /**************************************** thread pool *******************************************/
    @Resource
    private ThreadPoolValue threadPoolValue;

    @Bean
    public ThreadPoolManager threadPoolManager() {
        return new ThreadPoolManager(threadPoolValue.getCorePoolSize(),
                threadPoolValue.getMaximumPoolSize(), threadPoolValue.getKeepAliveTime(),
                threadPoolValue.getWorkQueue(), null);
    }
}
